#include <iostream>
int main(){
    std::cout << "请输入两个数字："  << std::endl;
    int v1,v2;
    std::cin >> v1 >> v2;
    int lower ,upper;
    //先比较两个数，保证lower是小数,upper 是大数
    if(v1<v2){
        lower = v1;
	upper = v2;
    }else{
	lower = v2;
	upper = v1;	

    }
    int sum = 0;
    //循环累加,sum用来为累加变量	
    for(int val = lower;val <= upper;++val){
	sum += val;
    }
    //输出结果
    std::cout << "从" << lower << "到" << upper <<  "的累加值为：" << sum << std::endl;
    return 0;


}
